Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1841 Closure detection fails in nested functions #1554

Merged
merged 1 commit into from Jan 27, 2013

Conversation

donc
Copy link
Collaborator

@donc donc commented Jan 26, 2013

If an escaping function doesn't use any closure variables itself, but is ultimately calls another nested function which does, it must be marked as needing a closure.

This 'calling a sibling nested function' case was missing. I've fixed this by constructing a simple call graph for nested functions. Note that nested functions cannot be forward referenced by other nested functions, so the call graph is a simple tree, with no cycles, and that makes it trivial to traverse.

If an escaping function doesn't use any closure variables, but
calls another nested function which does, it must be marked as
needing a closure. This 'calling a sibling' case was missing.
@WalterBright
Copy link
Member

WalterBright added a commit that referenced this pull request Jan 27, 2013
1841 Closure detection fails in nested functions
@WalterBright WalterBright merged commit 9ffbf88 into dlang:master Jan 27, 2013
@WalterBright
Copy link
Member

This is a partial fix to http://d.puremagic.com/issues/show_bug.cgi?id=8832

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants